<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:79:"/www/wwwroot/crm.liunuo.net/public/../application/user/view/customer/show.phtml";i:1552999926;s:60:"/www/wwwroot/crm.liunuo.net/application/user/view/base.phtml";i:1552999924;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><?php echo config('website.site_name')?></title>
    <link rel="stylesheet" href="/static/libs/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/base.css">
    <link rel="stylesheet" href="/static/css/fonts.css">
    
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header layui-bg-black">
        <div class="layui-logo"><img src="/static/user/images/logo.png" class="head-logo"></div>
        <ul class="layui-nav layui-layout-left">
            <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$v): ?>
            <li class="layui-nav-item <?php if(isset($breadcrumb['0']) and $breadcrumb['0'] == $v['name']): ?>layui-this<?php endif; ?>">
                <a href="<?php echo \think\Request::instance()->root(true); ?>/<?php if(empty($v['url'])): ?><?php echo $v['children']['0']['url']; else: ?><?php echo $v['url']; endif; ?>"><i class="<?php echo $v['icon']; ?>"></i> <?php echo $v['name']; ?></a>
            </li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item"><a href="/" target="_blank"><i class="fa fa-home"></i> 网站首页</a></li>
            <?php $remind_sum= today_remind_sum();?>
            <li class="layui-nav-item" style="text-align: right;"><a href="/user/customer/remind/"><i class="fa fa-bell"></i> 提醒消息 <span class="layui-badge"><?php echo $remind_sum['count']; ?></span></a></li>
            <li class="layui-nav-item">
                <a href="javascript:;"><i class="fa fa-user"></i> <?php if(session('user_auth.realname')): ?><?php echo session('user_auth.realname'); else: ?><?php echo session('user_auth.username'); endif; ?></a>
                <dl class="layui-nav-child">
                    <dd><a href="<?php echo url('user/index/editPassword'); ?>">修改密码</a></dd>
                    <dd><a href="<?php echo url('user/index/logout'); ?>">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree">
                <li class="layui-nav-item"><a href="<?php echo url('user/index/index'); ?>"><i class="fa fa-home fa-fw"></i> 系统首页</a></li>
                <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$n0): if(isset($n0['children']) and isset($breadcrumb['0']) and $breadcrumb['0'] == $n0['name']): if(is_array($n0['children']) || $n0['children'] instanceof \think\Collection || $n0['children'] instanceof \think\Paginator): if( count($n0['children'])==0 ) : echo "" ;else: foreach($n0['children'] as $key=>$n1): ?>
                <li class="layui-nav-item <?php if(isset($breadcrumb['1']) and $breadcrumb['1'] == $n1['name']): if(isset($n1['children'])): ?>layui-nav-itemed<?php else: ?>layui-this<?php endif; endif; ?>">
                    <a href="<?php if(isset($n1['children'])): ?>javascript:;<?php else: ?><?php echo \think\Request::instance()->root(true); ?>/<?php echo $n1['url']; endif; ?>"><i class="<?php echo $n1['icon']; ?> fa-fw"></i> <?php echo $n1['name']; ?></a>
                    <?php if(isset($n1['children'])): ?>
                    <dl class="layui-nav-child">
                        <?php if(is_array($n1['children']) || $n1['children'] instanceof \think\Collection || $n1['children'] instanceof \think\Paginator): if( count($n1['children'])==0 ) : echo "" ;else: foreach($n1['children'] as $key=>$n2): ?>
                        <dd<?php if(isset($breadcrumb['2']) and $breadcrumb['2'] == $n2['name']): ?> class="layui-this"<?php endif; ?>><a href="<?php echo \think\Request::instance()->root(true); ?>/<?php echo $n2['url']; ?>"><?php echo $n2['name']; ?></a></dd>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </dl>
                    <?php endif; ?>
                </li>
                <?php endforeach; endif; else: echo "" ;endif; endif; endforeach; endif; else: echo "" ;endif; ?>
            </ul>
        </div>
    </div>
    <div class="layui-breadcrumb">
        <?php if(isset($breadcrumb)): if(is_array($breadcrumb) || $breadcrumb instanceof \think\Collection || $breadcrumb instanceof \think\Paginator): if( count($breadcrumb)==0 ) : echo "" ;else: foreach($breadcrumb as $key=>$v): ?>
        <a><cite><?php echo $v; ?></cite></a>
        <?php endforeach; endif; else: echo "" ;endif; endif; ?>
    </div>
    <div class="layui-body">
        
<link rel="stylesheet" href="/static/layuiadmin/style/template.css" media="all">
<div class="layui-fluid layadmin-homepage-fluid">
    <div class="layui-row layui-col-space8">
        <div class="layui-col-md3">
            <div class="layadmin-homepage-panel layadmin-homepage-shadow">
                <div class="layui-card text-center">
                    <div class="layui-card-body">
                        <div class="layadmin-homepage-pad-ver">
                            <img class="layadmin-homepage-pad-img" src="/static/img/no_image_100x100.jpg" width="96" height="96">
                        </div>
                        <h4 class="layadmin-homepage-font"><?php echo $customer['cname']; ?></h4>
                        <p class="layadmin-homepage-min-font"><?php echo user_config_toval('intention',$customer['intention'],'customer'); ?></p>

                        <button class="layui-btn layui-btn-fluid"><i class="layui-icon layui-icon-cellphone"></i><?php echo $customer['mobile']; ?></button>
                    </div>
                </div>
                <p class="layadmin-homepage-about">
                    客户标签
                </p>
                <ul class="layadmin-homepage-list-inline">
                    <a href="javascript:;" class="layui-btn">来源：<?php echo user_config_toval('come_from',$customer['come_from'],'customer'); ?></a>
                    
                    <a href="javascript:;" class="layui-btn layui-btn-normal">类型：<?php echo user_config_toval('type',$customer['type'],'customer'); ?></a>
                    
                    <a href="javascript:;" class="layui-btn layui-btn-danger">状态：<?php echo user_config_toval('status',$customer['status'],'customer'); ?></a>
                </ul>
                <?php if(is_array($config_customer) || $config_customer instanceof \think\Collection || $config_customer instanceof \think\Paginator): if( count($config_customer)==0 ) : echo "" ;else: foreach($config_customer as $key=>$r): ?>
                <p class="layadmin-homepage-about">
                    <?php echo $r['title']; ?>
                </p>
                <ul class="layadmin-homepage-list-inline">
                    <?php if($r['type'] == 'input'): ?>
                    <a href="javascript:;" class="layui-btn"><?php if(isset($customer['jdata'][$r['name']])): ?><?php echo $customer['jdata'][$r['name']]; endif; ?></a>
                    <?php endif; if($r['type'] == 'textarea'): if(isset($customer['jdata'][$r['name']])): ?><?php echo $customer['jdata'][$r['name']]; endif; endif; if($r['type'] == 'select'): ?>
                    <a href="javascript:;" class="layui-btn"><?php if(isset($customer['jdata'][$r['name']])): ?><?php echo user_config_toval($r['name'],$customer['jdata'][$r['name']],'customer'); endif; ?></a>
                    <?php endif; if($r['type'] == 'radio'): ?>
                    <a href="javascript:;" class="layui-btn"><?php if(isset($customer['jdata'][$r['name']])): ?><?php echo user_config_toval($r['name'],$customer['jdata'][$r['name']],'customer'); endif; ?></a>
                    <?php endif; if($r['type'] == 'image'): if(isset($customer['jdata'][$r['name']])): ?><img src="<?php echo $customer['jdata'][$r['name']]; ?>"><?php endif; endif; ?>
                     
                </ul>
                <?php endforeach; endif; else: echo "" ;endif; ?>
                <p class="layadmin-homepage-about">
                    地址
                </p>
                <ul class="layadmin-homepage-list-group">
                    <li class="list-group-item"><i class="layui-icon layui-icon-location"></i><?php echo $customer['province']; ?><?php echo $customer['city']; ?><?php echo $customer['area']; ?> <?php echo $customer['address']; ?></li>
                </ul>
                <p class="layadmin-homepage-about">
                    备注信息
                </p>
                <div class="layadmin-homepage-pad-hor">
                    <mdall><?php echo $customer['remark']; ?></mdall><br><br>
                </div>
                
            </div>
        </div>
        <div class="layui-col-md9">
            <div class="layui-fluid layadmin-homepage-content">
                <div class="layui-row layui-col-space20 layadmin-homepage-list-imgtxt">
                    <div class="layui-col-md7">
                        <div class="grid-demo">
                            <?php if(is_array($track) || $track instanceof \think\Collection || $track instanceof \think\Paginator): if( count($track)==0 ) : echo "" ;else: foreach($track as $key=>$r): $user = \app\common\model\User::get($r['uid']);?>
                            <div class="panel-body layadmin-homepage-shadow">
                                <a href="javascript:;" class="media-left">
                                    <img src="/static/img/no_image_100x100.jpg" height="46px" width="46px">
                                </a>
                                <div class="media-body">
                                    <div class="pad-btm">
                                        <p class="fontColor"><a href="javascript:;"><?php if($user['realname']): ?><?php echo $user['realname']; else: ?><?php echo $user['username']; endif; ?></a>  <span><?php echo $r['create_time']; ?></span> 添加了新的<span> <?php echo user_config_toval('type',$r['type'],'track'); ?></span></p>
                                    </div>
                                    <p><?php echo $r['remark']; ?></p>
                                    <p>
                                        <?php if(is_array($config_track) || $config_track instanceof \think\Collection || $config_track instanceof \think\Paginator): if( count($config_track)==0 ) : echo "" ;else: foreach($config_track as $key=>$v): ?>
                                        <?php echo $v['title']; ?>:
                                            <?php if($v['type'] == 'input'): ?>
                                            <a href="javascript:;" class="layui-btn layui-btn-xs"><?php if(isset($r['jdata'][$v['name']])): ?><?php echo $r['jdata'][$v['name']]; endif; ?></a>
                                            <?php endif; if($v['type'] == 'textarea'): if(isset($r['jdata'][$v['name']])): ?><?php echo $r['jdata'][$v['name']]; endif; endif; if($v['type'] == 'select'): ?>
                                            <a href="javascript:;" class="layui-btn layui-btn-xs"><?php if(isset($r['jdata'][$v['name']])): ?><?php echo user_config_toval($v['name'],$r['jdata'][$v['name']],'track'); endif; ?></a>
                                            <?php endif; if($v['type'] == 'radio'): ?>
                                            <a href="javascript:;" class="layui-btn layui-btn-xs"><?php if(isset($r['jdata'][$v['name']])): ?><?php echo user_config_toval($v['name'],$r['jdata'][$v['name']],'track'); endif; ?></a>
                                            <?php endif; if($v['type'] == 'image'): if(isset($r['jdata'][$v['name']])): ?><img src="<?php echo $r['jdata'][$v['name']]; ?>" ><?php endif; endif; endforeach; endif; else: echo "" ;endif; ?></p>
                                    <div class="media">
                                        <div class="media-right">
                                            <ul class="list-inline">
                                                <li>
                                                    <a href="<?php echo url('user/customer/edit_track', ['id' => $r['id']]); ?>" class="layui-btn layui-btn-xs">修改</a>
                                                </li>
                                                <li>
                                                    <a href="<?php echo url('user/customer/del_track', ['id' => $r['id']]); ?>" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete">删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php endforeach; endif; else: echo "" ;endif; ?>
                            <div class="page"><?php echo $track->render(); ?></div>
                        </div>
                    </div>
                    <div class="layui-col-md5">
                        <div class="grid-demo">
                            <div class="layui-card homepage-top">
                                <div class="layui-card-header">
                                    <br>
                                    <h3 class="panel-title">
                                        <a href="<?php echo url('user/customer/edit', ['id' => $id]); ?>" class="layui-btn">修改客户</a>
                                        <a href="<?php echo url('user/customer/add_remind', ['id' => $id]); ?>" class="layui-btn layui-btn-danger">设置提醒</a>
                                        <a href="<?php echo url('user/customer/add_track', ['id' => $id]); ?>" class="layui-btn layui-btn-normal">新增跟踪</a>
                                        <a href="<?php echo url('user/order/add', ['cid' => $id]); ?>" class="layui-btn layui-btn-warm">新增交易</a>
                                    </h3>
                                </div>
                            </div>
                            <div class="layui-card">
                                <div class="layui-card-header">提醒日志</div>
                                <div class="layui-card-body">
                                    <ul class="layui-timeline">
                                        <?php if(is_array($remind) || $remind instanceof \think\Collection || $remind instanceof \think\Paginator): if( count($remind)==0 ) : echo "" ;else: foreach($remind as $key=>$r): ?>
                                        <li class="layui-timeline-item">
                                            <i class="layui-icon layui-timeline-axis"></i>
                                            <div class="layui-timeline-content layui-text">
                                              <div class="layui-timeline-title">
                                                <?php echo date('Y-m-d',$r['remind_time'])?> &nbsp;&nbsp;&nbsp;<?php echo $r['remark']; ?> &nbsp;&nbsp;
                                                <?php if(isset($r['jdata']['web']) and $r['jdata']['web'] =='on'): ?><i class="fa fa-comment" aria-hidden="true" title="后台提醒"></i> <?php endif; if(isset($r['jdata']['wechat']) and $r['jdata']['wechat'] =='on'): ?><i class="fa fa-weixin" aria-hidden="true" title="微信提醒"></i> <?php endif; if(isset($r['jdata']['sms']) and $r['jdata']['sms'] =='on'): ?><i class="fa fa-envelope-open" aria-hidden="true" title="短信提醒"></i> <?php endif; ?>
                                              </div>
                                            </div>
                                        </li>
                                        <?php endforeach; endif; else: echo "" ;endif; ?>
                                    </ul>
                                </div>
                            </div>

                            <div class="layui-card homepage-bottom">
                                <div class="layui-card-header">
                                    <h3 class="panel-title">
                                        <i class="layui-icon layui-icon-dollar"></i>
                                        交易情况
                                    </h3>
                                </div>
                                <div class="layui-card-body">
                                    <?php if(is_array($order) || $order instanceof \think\Collection || $order instanceof \think\Paginator): if( count($order)==0 ) : echo "" ;else: foreach($order as $key=>$o): ?>
                                    <a href="javascript:;" class="layadmin-privateletterlist-item">
                                      <div class="meida-left">
                                        ￥ <?php echo $o['total']; ?> 元
                                      </div>
                                      <div class="meida-right">
                                        <p><?php echo $o['create_time']; ?></p>
                                        <mdall><?php echo $o['remark']; ?></mdall>
                                      </div>
                                    </a>
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

    </div>
</div>

<script src="/static/libs/layui/layui.all.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/layui.base.js"></script>
<script src="/static/js/multiSelect.js"></script>
<script src="/static/js/common.js"></script>

<?php if($remind_sum['web'] > '0'): ?>
<script type="text/javascript">
    layer.msg('今日您有 <?php echo $remind_sum['count']; ?> 条信息待处理', {
            offset:'t',
            time: 5000, //不自动关闭
            btn: ['立即处理', '稍后处理'],
            yes: function(index){
                layer.close(index);
                window.location.href='/user/customer/remind/';
            }
        }
    );
</script>
<?php endif; ?>
</body>
</html>